/**
 * Copyright (c) Tapas Mobile.  All Rights Reserved.
 *
 * @author DaiHui 
 * @version 1.0
 */

package com.dotools.utils;

public class TypeUtils {

    public static int B2I(boolean b) {
        return b ? 1 : 0;
    }

    public static boolean I2B(int i) {
        return i == 1;
    }

    public static String B2IStr(boolean b){
        return b ? "1" : "0";
    }
    
    public static String B2StrToggle(boolean b){
        return b ? "on":"off";
    }

    public static boolean isEmptyString(String s) {
        if (s == null || s.length() == 0)
            return true;
        if (s.trim().length() == 0)
            return true;
        return false;
    }

}
